package datastructure.book.tujiesuanfa.tree.hard;

import datastructure.book.tujiesuanfa.tree.bean.TreeNode;

/**
 * 序列化与反序列化二叉树
 */
public class Codec {

    // Encodes a tree to a single string.
    public String serialize(TreeNode root) {
        return "";
    }

    // Decodes your encoded data to tree.
    public TreeNode deserialize(String data) {
        return null;
    }

    public static void main(String[] args) {
        Codec codec = new Codec();
        TreeNode node4 = new TreeNode(4);
        TreeNode node5 = new TreeNode(5);
        TreeNode node2 = new TreeNode(2);
        TreeNode node3 = new TreeNode(3,node4,node5);
        TreeNode node1 = new TreeNode(1,node2,node3);
        String serialize = codec.serialize(node1);
        System.out.println(serialize);
        codec.deserialize(serialize);
    }
}
